Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove global in favor of globalThis for better compatibility #11976

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

natew
Copy link
Contributor

@natew natew commented May 5, 2024

Please provide enough information so that others can review your pull request.

Motivation

I'm using react-navigation with Vite (browser-loaded esm) and this is actually really tricky to fix because imports are always hoisted above code, so my polyfill attempts get pushed below the react-navigation import unless I literally add a script tag above the app entrypoint.

Moving to globalThis should be safe and supported in most node/react-native/browsers from the last few years.

Test plan

I haven't tested thoroughly.

Copy link

github-actions bot commented May 5, 2024

Hey @natew! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

Copy link

github-actions bot commented May 5, 2024

Hey @autofix-ci[bot]! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

Copy link

netlify bot commented May 5, 2024

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit d0304ae
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/6637dfadc261600008972312
😎 Deploy Preview https://deploy-preview-11976--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 5, 2024

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit 2e3e70c
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/667d59bfe233af00082ba031
😎 Deploy Preview https://deploy-preview-11976--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR

@satya164 satya164 enabled auto-merge (squash) June 27, 2024 12:23
@satya164 satya164 merged commit f497491 into react-navigation:main Jun 27, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants